package org.huatek.anders.service;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import org.huatek.anders.entity.OrderEntity;
import org.huatek.anders.entity.PayEntity;
import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author anders
 * @date 2018-11-28 13:25
 **/
@Service
@Slf4j
public class PayServiceImpl implements PayService{

    @Reference
    RefundNotifySenderService refundNotifySenderService;

    @Override
    public boolean payCallback(PayEntity payEntity) {

        OrderEntity order = new OrderEntity();
        order.setId(10000L);
        order.setOrderNo(String.valueOf(System.currentTimeMillis()));
        order.setAmount(new BigDecimal("1999.99"));
        order.setCreateTime(new Date());
        refundNotifySenderService.sender(order);
        return false;
    }
}
